package cn.wolfcode.luowowo.query;

import lombok.Getter;
import lombok.Setter;

import java.util.HashMap;
import java.util.Map;

/**
 * 游记范围查询条件：封装键值对的映射关系
 */
@Getter
public class TravelCondition {
    //映射数据初始化k-v对，
    public static final Map<Integer,TravelCondition> MAP_PEREXPEND = new HashMap<>();//人均消费
    public static final Map<Integer,TravelCondition> MAP_DAY = new HashMap<>();//旅游天数

    //用静态代码框将 表示范围 的数据初始化
    static {
        MAP_PEREXPEND.put(1, new TravelCondition(1,999));
        MAP_PEREXPEND.put(2, new TravelCondition(1000,6000));
        MAP_PEREXPEND.put(3, new TravelCondition(6001,20000));
        MAP_PEREXPEND.put(4, new TravelCondition(20001,Integer.MAX_VALUE));

        MAP_DAY.put(1, new TravelCondition(0,3));
        MAP_DAY.put(2, new TravelCondition(4,7));
        MAP_DAY.put(3, new TravelCondition(8,14));
        MAP_DAY.put(4, new TravelCondition(15,Integer.MAX_VALUE));
    }

    //最大最小值
    private int min;
    private int max;

    //构造器
    public TravelCondition(int min, int max){
        this.min = min;
        this.max = max;
    }
}
